var colorNamesCodes = new Array();

colorNamesCodes["aliceblue"] = "f0f8ff";
colorNamesCodes["antiquewhite"] = "faebd7";
colorNamesCodes["aqua"] = "00ffff";
colorNamesCodes["aquamarine"] = "7fffd4";
colorNamesCodes["azure"] = "f0ffff";
colorNamesCodes["beige"] = "f5f5dc";
colorNamesCodes["bisque"] = "ffe4c4";
colorNamesCodes["black"] = "000000";
colorNamesCodes["blanchedalmond"] = "ffebcd";
colorNamesCodes["blue"] = "0000ff";
colorNamesCodes["blueviolet"] = "8a2be2";
colorNamesCodes["brown"] = "a52a2a";
colorNamesCodes["burlywood"] = "deb887";
colorNamesCodes["cadetblue"] = "5f9ea0";
colorNamesCodes["chartreuse"] = "7fff00";
colorNamesCodes["chocolate"] = "d2691e";
colorNamesCodes["coral"] = "ff7f50";
colorNamesCodes["cornflowerblue"] = "6495ed";
colorNamesCodes["cornsilk"] = "fff8dc";
colorNamesCodes["crimson"] = "dc143c";
colorNamesCodes["cyan"] = "00ffff";
colorNamesCodes["darkblue"] = "00008b";
colorNamesCodes["darkcyan"] = "008b8b";
colorNamesCodes["darkgoldenrod"] = "b8860b";
colorNamesCodes["darkgray"] = "a9a9a9";
colorNamesCodes["darkgreen"] = "006400";
colorNamesCodes["darkkhaki"] = "bdb76b";
colorNamesCodes["darkmagenta"] = "8b008b";
colorNamesCodes["darkolivegreen"] = "556b2f";
colorNamesCodes["darkorange"] = "ff8c00";
colorNamesCodes["darkorchid"] = "9932cc";
colorNamesCodes["darkred"] = "8b0000";
colorNamesCodes["darksalmon"] = "e9967a";
colorNamesCodes["darkseagreen"] = "8fbc8f";
colorNamesCodes["darkslateblue"] = "483d8b";
colorNamesCodes["darkslategray"] = "2f4f4f";
colorNamesCodes["darkturquoise"] = "00ced1";
colorNamesCodes["darkviolet"] = "9400d3";
colorNamesCodes["deeppink"] = "ff1493";
colorNamesCodes["deepskyblue"] = "00bfff";
colorNamesCodes["dimgray"] = "696969";
colorNamesCodes["dodgerblue"] = "1e90ff";
colorNamesCodes["firebrick"] = "b22222";
colorNamesCodes["floralwhite"] = "fffaf0";
colorNamesCodes["forestgreen"] = "228b22";
colorNamesCodes["fuchsia"] = "ff00ff";
colorNamesCodes["gainsboro"] = "dcdcdc";
colorNamesCodes["ghostwhite"] = "f8f8ff";
colorNamesCodes["gold"] = "ffd700";
colorNamesCodes["goldenrod"] = "daa520";
colorNamesCodes["gray"] = "808080";
colorNamesCodes["green"] = "008000";
colorNamesCodes["greenyellow"] = "adff2f";
colorNamesCodes["honeydew"] = "f0fff0";
colorNamesCodes["hotpink"] = "ff69b4";
colorNamesCodes["indianred "] = "cd5c5c";
colorNamesCodes["indigo "] = "4b0082";
colorNamesCodes["ivory"] = "fffff0";
colorNamesCodes["khaki"] = "f0e68c";
colorNamesCodes["lavender"] = "e6e6fa";
colorNamesCodes["lavenderblush"] = "fff0f5";
colorNamesCodes["lawngreen"] = "7cfc00";
colorNamesCodes["lemonchiffon"] = "fffacd";
colorNamesCodes["lightblue"] = "add8e6";
colorNamesCodes["lightcoral"] = "f08080";
colorNamesCodes["lightcyan"] = "e0ffff";
colorNamesCodes["lightgoldenrodyellow"] = "fafad2";
colorNamesCodes["lightgrey"] = "d3d3d3";
colorNamesCodes["lightgreen"] = "90ee90";
colorNamesCodes["lightpink"] = "ffb6c1";
colorNamesCodes["lightsalmon"] = "ffa07a";
colorNamesCodes["lightseagreen"] = "20b2aa";
colorNamesCodes["lightskyblue"] = "87cefa";
colorNamesCodes["lightslategray"] = "778899";
colorNamesCodes["lightsteelblue"] = "b0c4de";
colorNamesCodes["lightyellow"] = "ffffe0";
colorNamesCodes["lime"] = "00ff00";
colorNamesCodes["limegreen"] = "32cd32";
colorNamesCodes["linen"] = "faf0e6";
colorNamesCodes["magenta"] = "ff00ff";
colorNamesCodes["maroon"] = "800000";
colorNamesCodes["mediumaquamarine"] = "66cdaa";
colorNamesCodes["mediumblue"] = "0000cd";
colorNamesCodes["mediumorchid"] = "ba55d3";
colorNamesCodes["mediumpurple"] = "9370d8";
colorNamesCodes["mediumseagreen"] = "3cb371";
colorNamesCodes["mediumslateblue"] = "7b68ee";
colorNamesCodes["mediumspringgreen"] = "00fa9a";
colorNamesCodes["mediumturquoise"] = "48d1cc";
colorNamesCodes["mediumvioletred"] = "c71585";
colorNamesCodes["midnightblue"] = "191970";
colorNamesCodes["mintcream"] = "f5fffa";
colorNamesCodes["mistyrose"] = "ffe4e1";
colorNamesCodes["moccasin"] = "ffe4b5";
colorNamesCodes["navajowhite"] = "ffdead";
colorNamesCodes["navy"] = "000080";
colorNamesCodes["oldlace"] = "fdf5e6";
colorNamesCodes["olive"] = "808000";
colorNamesCodes["olivedrab"] = "6b8e23";
colorNamesCodes["orange"] = "ffa500";
colorNamesCodes["orangered"] = "ff4500";
colorNamesCodes["orchid"] = "da70d6";
colorNamesCodes["palegoldenrod"] = "eee8aa";
colorNamesCodes["palegreen"] = "98fb98";
colorNamesCodes["paleturquoise"] = "afeeee";
colorNamesCodes["palevioletred"] = "d87093";
colorNamesCodes["papayawhip"] = "ffefd5";
colorNamesCodes["peachpuff"] = "ffdab9";
colorNamesCodes["peru"] = "cd853f";
colorNamesCodes["pink"] = "ffc0cb";
colorNamesCodes["plum"] = "dda0dd";
colorNamesCodes["powderblue"] = "b0e0e6";
colorNamesCodes["purple"] = "800080";
colorNamesCodes["red"] = "ff0000";
colorNamesCodes["rosybrown"] = "bc8f8f";
colorNamesCodes["royalblue"] = "4169e1";
colorNamesCodes["saddlebrown"] = "8b4513";
colorNamesCodes["salmon"] = "fa8072";
colorNamesCodes["sandybrown"] = "f4a460";
colorNamesCodes["seagreen"] = "2e8b57";
colorNamesCodes["seashell"] = "fff5ee";
colorNamesCodes["sienna"] = "a0522d";
colorNamesCodes["silver"] = "c0c0c0";
colorNamesCodes["skyblue"] = "87ceeb";
colorNamesCodes["slateblue"] = "6a5acd";
colorNamesCodes["slategray"] = "708090";
colorNamesCodes["snow"] = "fffafa";
colorNamesCodes["springgreen"] = "00ff7f";
colorNamesCodes["steelblue"] = "4682b4";
colorNamesCodes["tan"] = "d2b48c";
colorNamesCodes["teal"] = "008080";
colorNamesCodes["thistle"] = "d8bfd8";
colorNamesCodes["tomato"] = "ff6347";
colorNamesCodes["turquoise"] = "40e0d0";
colorNamesCodes["violet"] = "ee82ee";
colorNamesCodes["wheat"] = "f5deb3";
colorNamesCodes["white"] = "ffffff";
colorNamesCodes["whitesmoke"] = "f5f5f5";
colorNamesCodes["yellow"] = "ffff00";
colorNamesCodes["yellowgreen"] = "9acd32";

function getColorCodeByName(strName){
  var strCode = colorNamesCodes[strName.toLowerCase().split(' ').join('')]; 
  
  if(!strCode){
    strCode = strName;	
  }

  return strCode;
}
